<?php

class MCollection implements ArrayAccess,IteratorAggregate
{
    public $objectArray = Array();
    //**these are the required iterator functions   
    function offsetExists($offset)
    {         
        if(isset($this->objectArray[$offset]))  return TRUE;
        else return FALSE;         
    }   
   
    function offsetGet($offset)
    {  
        if ($this->offsetExists($offset))  return $this->objectArray[$offset];
        else return (false);
    }
   
    function offsetSet($offset, $value)
    {         
        if ($offset)  $this->objectArray[$offset] = $value;
        else  $this->objectArray[] = $value;
    }
   
    function offsetUnset($offset)
    {
        unset ($this->objectArray[$offset]);
    }
   
    function & getIterator()
    {
        return new ArrayIterator($this->objectArray);
    }
    //**end required iterator functions
    public function size(){
    	return sizeof($this->objectArray);
    }

}

?>